package firewall;

public class Paquete {
	
	private long ipOrigen;
	private long ipDestino;
	private int puerto;
	
	public Paquete(String ipOrigen, String ipDestino, int puerto) {
		this.setIpOrigen(ipOrigen);
		this.setIpDestino(ipDestino);
		this.setPuerto(puerto);
	}
	
	public int getPuerto() {
		return this.puerto;
	}
	public void setPuerto(int puerto) {
		this.puerto = puerto;
	}
	public long getIpDestino() {
		return this.ipDestino;
	}
	public void setIpDestino(String ipDestino) {
		this.ipDestino = Long.parseLong(ipDestino.replaceAll("\\D", ""));
	}
	
	public long getIpOrigen() {
		return this.ipOrigen;
	}
	public void setIpOrigen(String ipOrigen) {
		this.ipOrigen = Long.parseLong(ipOrigen.replaceAll("\\D", ""));
	}
	
	@Override
	public String toString() {
		return " Paquete [ipOrigen=" + this.ipOrigen + ", ipDestino=" + this.ipDestino
				+ ", puerto=" + this.puerto + "]";
	}
	
	
	
}
